Trojan
Trojan protocol.
InboundConfigurationObject
InboundConfigurationObject corresponds to the settings item in InboundObject.
{
"inbounds": [
{
// ...
"protocol": "trojan",
"settings": {
"users": [
{
"password": "password",
"email": "love@xray.com",
"level": 0
}
],
"fallbacks": [
{
"dest": 80
}
]
}
}
]
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
WARNING
Trojan must be used with transport-security TLS; using streamSettings.security: "none" is only allowed when the peer is a private address (such as a private IP address or private domain name) and the link itself is trusted. In public environments, Mux is also required; otherwise, once the inner payload is itself TLS, it becomes TiT and can be easily detected (PoC).
users: [ UserObject ]
An array representing a group of users accepted by the server.
Each item is a UserObject.
fallbacks: [ FallbackObject ]
An array containing a series of powerful fallback configurations (optional). For specific configuration of fallbacks, please click FallbackObject.
TIP
Xray's Trojan has complete support for fallbacks, and the configuration method is exactly the same as VLESS. The conditions for triggering fallback are also similar to VLESS: the length of the first packet < 58, OR the 57th byte is not \r (because Trojan has no protocol version), OR authentication fails.
UserObject
{
"password": "password",
"email": "love@xray.com",
"level": 0
}2
3
4
5
password: string
Required, any string.
Email address, optional, used to identify the user.
DANGER
If there are multiple UserObjects, please note that emails must not be duplicated.
level: number
User level. Connections will use the Local Policy corresponding to this user level.
The value of userLevel corresponds to the value of level in policy. If not specified, it defaults to 0.